from transformers import pipeline


summarizer = pipeline(task="summarization",
                      model="t5-base",
                      min_length=8,
                      max_length=32,
                      )
result = summarizer("In this work, we presented the Transformer, the first sequence transduction model based entirely on attention, "
                    "replacing the recurrent layers most commonly used in encoder-decoder architectures with multi-headed self-attention. "
                    "For translation tasks, the Transformer can be trained significantly faster than architectures based on recurrent or convolutional layers. "
                    "On both WMT 2014 English-to-German and WMT 2014 English-to-French translation tasks, we achieve a new state of the art. "
                    "In the former task our best model outperforms even all previously reported ensembles.")

print("summarization：", result)